


Shuffle

by NMTD



Series: Mathematical Thought Experiments [1]
Category: mathematics - Fandom
Genre: Gen, Unsolved, math problem
Language: English
Status: Completed
Published: 2021-03-18
Updated: 2021-03-18
Packaged: 2021-03-26 23:41:58
Rating: Teen And Up Audiences
Warnings: No Archive Warnings Apply
Chapters: 1
Words: 446
Publisher: archiveofourown.org
Story URL: https://archiveofourown.org/works/30113844
Author URL: https://archiveofourown.org/users/NMTD/pseuds/NMTD
Summary: This is not a story.  It's a math puzzle about shuffling cards.  I'm serious.
Series: Mathematical Thought Experiments [1]
Series URL: https://archiveofourown.org/series/2224911





	Shuffle

**Author's Note:**

> Forgive my willfulness and play along with me for a minute here. I'm in a bad mood and want to post something, but I don't think I can write, so here's a different kind of thought experiments. I'm serious. This really is math and nothing else. If it's against any rules around here please let me know, but otherwise just leave it if it bothers you.

We had a family friends' gathering one day, and one of them brought a silly but long game of fortune telling with a regular deck of playing cards. The idea of the game is that we shuffle the cards and keep taking the top and bottom cards in the deck to see if their numbers matched. If they did, we added the pair to the list of cards we use to do the fortune telling, with each number representing a different question and each suit representing an answer of some sort. If the top and bottom cards didn’t match, which was too often the case, we added them to the discard pile.

I wasn’t all that interested in the fortune telling part, but the discarding process kept coming back to me. It was difficult to collect all pairs of cards we needed, and we had to keep reusing the discard pile when we ran out. Was it possible for us to be in a loop of discarding cards and reusing the discard pile, never to find another pair of matching numbers? How many times would we go through the discard pile to complete the loop?

So I defined a few things to make it a problem:

Suppose we have a deck of cards numbered from 0 to n, and initially they are in numerical order in a pile from the bottom to the top like this:

0, 1, 2, 3, … n

For simplicity’s sake, let’s say the numbers are printed on both sides, and that there is no difference between the two sides. Also, when we “shuffle” using the process above, we don’t turn over any group of cards. This prevents us from changing the order of the cards in other ways. If we keep taking the top and bottom cards and adding them to the discard pile, when we run out of cards, the discard pile would look like this:

0, n, 1, n-1, 2, n-2, …

For clarity, let’s try this for n=6

Iteration 0 (starting): 0, 1, 2, 3, 4, 5, 6

Iteration 1: 0, 6, 1, 5, 2, 4, 3

Iteration 2: 0, 3, 6, 4, 1, 2, 5

Iteration 3: 0, 5, 3, 2, 6, 1, 4

Iteration 4: 0, 4, 5, 1, 3, 6, 2

Iteration 5: 0, 2, 4, 6, 5, 3, 1

Iteration 6: 0, 1, 2, 3, 4, 5, 6

Now we are back to where we started, and it took 6 iterations.

The question is for any given natural number n, can we find out how many iterations of this shuffling process we have to go through to return to the order of the original deck?

**Author's Note:**

> Writing is my mistress, and math is my true love. I know it's rare, but if you share that appreciation for math with me, lemme know what you think of this. Don't post full solutions, but feel free to drop hints and discuss progress.


End file.
